<html>
<head><meta charset="utf-8"><title>Post Christmas hack days · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html">Post Christmas hack days</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="184007284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184007284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184007284">(Dec 21 2019 at 11:31)</a>:</h4>
<p>Hi <span class="user-group-mention" data-user-group-id="1162">@WG-mir-opt</span> Let's hack on mir opt things all day on 27/28 December. If you want to join, I set up <a href="https://meet.jit.si/wg-mir-opt" target="_blank" title="https://meet.jit.si/wg-mir-opt">https://meet.jit.si/wg-mir-opt</a> and will be hanging out there starting around 9 or 10 CET on these days.</p>



<a name="184007289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184007289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184007289">(Dec 21 2019 at 11:31)</a>:</h4>
<p>Let's use this thread to figure out fun things for everyone to work on</p>



<a name="184007336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184007336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184007336">(Dec 21 2019 at 11:32)</a>:</h4>
<p>You're also totally welcome to join if you just want to hang out, there's no requirement to do any work.</p>



<a name="184014379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184014379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184014379">(Dec 21 2019 at 15:22)</a>:</h4>
<p>I'll join in around 10:30 CET after I've made some <span aria-label="coffee" class="emoji emoji-2615" role="img" title="coffee">:coffee:</span> :)</p>



<a name="184019605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184019605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184019605">(Dec 21 2019 at 18:01)</a>:</h4>
<p>It would be nice if <a href="https://github.com/rust-lang/rust/issues/63802" target="_blank" title="https://github.com/rust-lang/rust/issues/63802">#63802</a> (mir inliner panic) gets fixed.</p>



<a name="184029560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184029560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184029560">(Dec 21 2019 at 23:06)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> It's on the list of things we're going to look at and I've already gotten a head start (see PR <a href="https://github.com/rust-lang/rust/issues/67333" target="_blank" title="https://github.com/rust-lang/rust/issues/67333">#67333</a>)</p>



<a name="184032861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184032861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184032861">(Dec 22 2019 at 00:54)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> I've talked with <span class="user-mention" data-user-id="124288">@oli</span> about this briefly but do you have a list of things to do published? otherwise could be nice if we can write something down</p>



<a name="184035418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184035418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184035418">(Dec 22 2019 at 02:24)</a>:</h4>
<p>The list is currently just</p>
<ul>
<li>Use the new dataflow framework in const prop to const prop more stuff</li>
<li>Fix the inliner (aka resolve <a href="https://github.com/rust-lang/rust/issues/63802" target="_blank" title="https://github.com/rust-lang/rust/issues/63802">#63802</a>)</li>
</ul>



<a name="184035538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184035538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184035538">(Dec 22 2019 at 02:29)</a>:</h4>
<p>I'm also thinking about mir librarification <a href="https://github.com/rust-lang/compiler-team/issues/233" target="_blank" title="https://github.com/rust-lang/compiler-team/issues/233">https://github.com/rust-lang/compiler-team/issues/233</a></p>



<a name="184058650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184058650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184058650">(Dec 22 2019 at 15:31)</a>:</h4>
<p>Found another bug (probably in the mir inliner): <a href="https://github.com/rust-lang/rust/issues/67529" target="_blank" title="https://github.com/rust-lang/rust/issues/67529">https://github.com/rust-lang/rust/issues/67529</a></p>



<a name="184072136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184072136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184072136">(Dec 22 2019 at 22:33)</a>:</h4>
<p>Another fun idea: <a href="https://github.com/rust-lang/rust/issues/67539#issuecomment-568308568" target="_blank" title="https://github.com/rust-lang/rust/issues/67539#issuecomment-568308568">https://github.com/rust-lang/rust/issues/67539#issuecomment-568308568</a></p>



<a name="184309309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184309309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184309309">(Dec 27 2019 at 09:01)</a>:</h4>
<p>I'll be there in a sec</p>



<a name="184309477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184309477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184309477">(Dec 27 2019 at 09:05)</a>:</h4>
<p>just joined</p>



<a name="184311548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311548">(Dec 27 2019 at 09:39)</a>:</h4>
<p>who is player 3? :D</p>



<a name="184311554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311554">(Dec 27 2019 at 09:39)</a>:</h4>
<p>me</p>



<a name="184311555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311555">(Dec 27 2019 at 09:39)</a>:</h4>
<p>ah :D <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="184311560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311560">(Dec 27 2019 at 09:39)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="184311699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311699">(Dec 27 2019 at 09:43)</a>:</h4>
<p>ok, my notifications have been used up, my reviews are done. Ready to do stuff</p>



<a name="184311977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311977">(Dec 27 2019 at 09:50)</a>:</h4>
<p>visiting, I will listen carefully. <span aria-label="rocket" class="emoji emoji-1f680" role="img" title="rocket">:rocket:</span></p>



<a name="184311986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184311986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184311986">(Dec 27 2019 at 09:50)</a>:</h4>
<p>:D not sure how much talking will be going on</p>



<a name="184312012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312012">(Dec 27 2019 at 09:51)</a>:</h4>
<p>:D let's see, I will try my best.</p>



<a name="184312086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312086">(Dec 27 2019 at 09:52)</a>:</h4>
<p>so the current project status is</p>
<ul>
<li>santiago works on <a href="https://github.com/rust-lang/rust/issues/67000" target="_blank" title="https://github.com/rust-lang/rust/issues/67000">#67000</a></li>
<li>
<p>wesley works on <br>
    - Use the new dataflow framework in const prop to const prop more stuff<br>
    - Fix the inliner (aka resolve <a href="https://github.com/rust-lang/rust/issues/63802" target="_blank" title="https://github.com/rust-lang/rust/issues/63802">#63802</a>)</p>
</li>
<li>
<p>oli works on ... I actually don't know yet</p>
</li>
</ul>



<a name="184312096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312096">(Dec 27 2019 at 09:52)</a>:</h4>
<p>I'm gonna create a hackmd so we can collect all this info and update it and also add project ideas</p>



<a name="184312209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312209">(Dec 27 2019 at 09:54)</a>:</h4>
<p>is wesley around already?</p>



<a name="184312310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312310">(Dec 27 2019 at 09:57)</a>:</h4>
<p>mahmut wants to work on this <a href="https://github.com/rust-lang/rust/issues/49206" target="_blank" title="https://github.com/rust-lang/rust/issues/49206">#49206</a></p>



<a name="184312391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312391">(Dec 27 2019 at 09:59)</a>:</h4>
<p><a href="https://hackmd.io/@oli-obk/ByKo48XJU" target="_blank" title="https://hackmd.io/@oli-obk/ByKo48XJU">https://hackmd.io/@oli-obk/ByKo48XJU</a></p>



<a name="184312472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312472">(Dec 27 2019 at 10:01)</a>:</h4>
<p>@mahmut related info: <a href="https://github.com/rust-lang/const-eval/pull/33#discussion_r361555939" target="_blank" title="https://github.com/rust-lang/const-eval/pull/33#discussion_r361555939">https://github.com/rust-lang/const-eval/pull/33#discussion_r361555939</a></p>



<a name="184312542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312542">(Dec 27 2019 at 10:03)</a>:</h4>
<p>I think we could start with creating a lint that triggers on final constants whose value contains a non-public <code>!Sync</code> type</p>



<a name="184312601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312601">(Dec 27 2019 at 10:04)</a>:</h4>
<p>so <code>*const u8</code> is ok, so is any value of <code>struct Foo { pub bar: *const u8 }</code>, but not <code>struct Bar { bar: *const u8 }</code> and <code>struct Mep { foo: Foo }</code></p>



<a name="184312609"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312609" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312609">(Dec 27 2019 at 10:04)</a>:</h4>
<p>basically if the value is publicly reachable, noone can make any assumptions about the fields anyway, becaues anyone can modify the fields</p>



<a name="184312690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312690">(Dec 27 2019 at 10:07)</a>:</h4>
<p>oh I think I got it.</p>



<a name="184312701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312701">(Dec 27 2019 at 10:07)</a>:</h4>
<blockquote>
<div class="codehilite"><pre><span></span>- Fix the inliner (aka resolve #63802)
</pre></div>


</blockquote>
<p>I found some more mir inliner issues: <a href="https://github.com/rust-lang/rust/issues/created_by/bjorn3" target="_blank" title="https://github.com/rust-lang/rust/issues/created_by/bjorn3">https://github.com/rust-lang/rust/issues/created_by/bjorn3</a> (until <a href="https://github.com/rust-lang/rust/issues/67529" target="_blank" title="https://github.com/rust-lang/rust/issues/67529">#67529</a>) Most of which are miscompilation and creating broken MIR.</p>



<a name="184312705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312705">(Dec 27 2019 at 10:07)</a>:</h4>
<p>e.g. I see no reason why we should be forbidding <code>static FOO: *const u8 = &1;</code> today</p>



<a name="184312716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312716">(Dec 27 2019 at 10:08)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> are these related to the resolve problem or independent?</p>



<a name="184312815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312815">(Dec 27 2019 at 10:09)</a>:</h4>
<p>The Vec::index one may be related, but the rest isn't I think.</p>



<a name="184312913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312913">(Dec 27 2019 at 10:10)</a>:</h4>
<p>Can I ask completely unrelated question, because I want to know the reasoning to ban/unban this in the future:<br>
<a href="https://github.com/rust-lang/rust/issues/67191#issuecomment-568024316" target="_blank" title="https://github.com/rust-lang/rust/issues/67191#issuecomment-568024316">https://github.com/rust-lang/rust/issues/67191#issuecomment-568024316</a></p>



<a name="184312915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> DPC <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312915">(Dec 27 2019 at 10:10)</a>:</h4>
<p>Any small/easy issue to start with? :P</p>



<a name="184312948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184312948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184312948">(Dec 27 2019 at 10:11)</a>:</h4>
<p>From my point of view <code>const FOO: ! = panic!();</code> this is valid in no_std context.</p>



<a name="184313040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313040">(Dec 27 2019 at 10:13)</a>:</h4>
<p><span class="user-mention" data-user-id="223879">@vertexclique</span> the problem isn't the constant. If you declare that constant that is completely sound if we just lint and don't error</p>



<a name="184313085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313085">(Dec 27 2019 at 10:14)</a>:</h4>
<p>the problem is <code>let x: ! = FOO;</code> because now you have a value of type <code>!</code> and if that happens at runtime that's instant UB</p>



<a name="184313153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> vertexclique <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313153">(Dec 27 2019 at 10:16)</a>:</h4>
<p>_enlightened_</p>



<a name="184313316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313316">(Dec 27 2019 at 10:21)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> Good morning!</p>



<a name="184313460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313460">(Dec 27 2019 at 10:25)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="184313539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313539">(Dec 27 2019 at 10:28)</a>:</h4>
<p>I'm still plugging away at the resolve+specialization issue. <span class="user-mention" data-user-id="124288">@oli</span> I rebased on top of your pr (<a href="https://github.com/rust-lang/rust/issues/67631" target="_blank" title="https://github.com/rust-lang/rust/issues/67631">#67631</a>) and while I believe that did fix a few things, I'm still seeing that weird LLVM issue.</p>



<a name="184313614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313614">(Dec 27 2019 at 10:29)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> the resolve fix PR should actually <em>undo</em> <a href="https://github.com/rust-lang/rust/issues/67631" target="_blank" title="https://github.com/rust-lang/rust/issues/67631">#67631</a> and not keep using it</p>



<a name="184313621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313621">(Dec 27 2019 at 10:29)</a>:</h4>
<p>I think?</p>



<a name="184313627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313627">(Dec 27 2019 at 10:29)</a>:</h4>
<p>Well, I think after my change, there will be more things that do not resolve to a specific instance</p>



<a name="184313671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313671">(Dec 27 2019 at 10:30)</a>:</h4>
<p>Which currently <em>are</em> albeit incorrectly</p>



<a name="184313766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313766">(Dec 27 2019 at 10:33)</a>:</h4>
<p>but that's ok, if resolve fails with <code>TooGeneric</code>, const prop bails out</p>



<a name="184313848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313848">(Dec 27 2019 at 10:35)</a>:</h4>
<p>Ah, yeah you're right</p>



<a name="184313857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313857">(Dec 27 2019 at 10:35)</a>:</h4>
<p>if there's a difference whether you rebased over my PR or not, that means the resolve PR still has bugs</p>



<a name="184313901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313901">(Dec 27 2019 at 10:36)</a>:</h4>
<p>I'm still seeing some failing ui tests so that's very possible</p>



<a name="184313947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313947">(Dec 27 2019 at 10:37)</a>:</h4>
<p>do you have the current status somewhere?</p>



<a name="184313952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184313952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184313952">(Dec 27 2019 at 10:37)</a>:</h4>
<p>also: did you ever see any ICEs where stuff couldn't be loaded from metadata?</p>



<a name="184314033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314033">(Dec 27 2019 at 10:39)</a>:</h4>
<p>I'll force push to my branch in a second</p>



<a name="184314035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314035">(Dec 27 2019 at 10:39)</a>:</h4>
<p>I don't think I've ever seen that</p>



<a name="184314045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314045">(Dec 27 2019 at 10:39)</a>:</h4>
<p>k good to know, because my dedup PR definitely has this problem XD</p>



<a name="184314050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314050">(Dec 27 2019 at 10:40)</a>:</h4>
<p>But I was focused on getting the ui and mir-opt tests passing so I probably wasn't exercising the incremental functionality</p>



<a name="184314089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314089">(Dec 27 2019 at 10:40)</a>:</h4>
<p>nah, this was in ui tests</p>



<a name="184314091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314091">(Dec 27 2019 at 10:40)</a>:</h4>
<p>Oh</p>



<a name="184314095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314095">(Dec 27 2019 at 10:40)</a>:</h4>
<p>Nah I didn't see that</p>



<a name="184314100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314100">(Dec 27 2019 at 10:40)</a>:</h4>
<p>cool, that cuts down the places I need to look at</p>



<a name="184314118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314118">(Dec 27 2019 at 10:41)</a>:</h4>
<p>Maybe I should wait until your PR is done and rebase over it so I have fewer things to worry about</p>



<a name="184314122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314122">(Dec 27 2019 at 10:41)</a>:</h4>
<p>that deduplication is triggering many assertions in rustc that are made on assumptions that just aren't universally true</p>



<a name="184314195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314195">(Dec 27 2019 at 10:43)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...wesleywiser:optimizations_handle_specialization?expand=1" target="_blank" title="https://github.com/rust-lang/rust/compare/master...wesleywiser:optimizations_handle_specialization?expand=1">https://github.com/rust-lang/rust/compare/master...wesleywiser:optimizations_handle_specialization?expand=1</a></p>



<a name="184314285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314285">(Dec 27 2019 at 10:45)</a>:</h4>
<p>Here's where we're at:</p>
<ul>
<li>There's still the "erroneous constant used" test change which we think might be a symptom of the same thing that's causing the LLVM issue.</li>
<li>The <code>ui/rfcs/rfc-2005-default-binding-mode/constref.rs</code> test is failing<ul>
<li><code>error[E0158]: associated consts cannot be referenced in patterns</code></li>
</ul>
</li>
<li>The <code>ui/ufcs-polymorphic-paths.rs</code> test is failing<ul>
<li><code>Global is external, but doesn't have external or weak linkage! i64 ()** @_ZN22ufcs_polymorphic_paths4main1S17h617838d98e0a145aE</code></li>
</ul>
</li>
</ul>



<a name="184314335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314335">(Dec 27 2019 at 10:46)</a>:</h4>
<p>All other ui and mir-opt tests pass</p>



<a name="184314415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314415">(Dec 27 2019 at 10:48)</a>:</h4>
<p>yea, so the "erroneous constant used" is weird. The constant being used is entriely monomorphic, but const prop still bails out on it and then codegen catches it</p>



<a name="184314449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314449">(Dec 27 2019 at 10:49)</a>:</h4>
<p>Maybe it's silenced due to the reveal mode being <code>UserFacing</code> and not <code>All</code></p>



<a name="184314493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314493">(Dec 27 2019 at 10:50)</a>:</h4>
<p>oh, also you need to rebase again to get my full PR</p>



<a name="184314499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314499">(Dec 27 2019 at 10:50)</a>:</h4>
<p>but that shouldn't change anything</p>



<a name="184314518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314518">(Dec 27 2019 at 10:51)</a>:</h4>
<p>Yeah, I figured it probably wouldn't make a difference so I haven't rebased yet</p>



<a name="184314559"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314559" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314559">(Dec 27 2019 at 10:52)</a>:</h4>
<p>so... maybe const prop optimizing functions that are not generic should set the reveal mode to <code>Reveal::All</code>?</p>



<a name="184314591"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314591" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314591">(Dec 27 2019 at 10:53)</a>:</h4>
<p>I have a cut down version of <code>ufcs-polymorphic-paths.rs</code> that might be helpful:</p>
<div class="codehilite"><pre><span></span><span class="c1">// run-pass</span>

<span class="k">fn</span> <span class="nf">eq</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nb">Eq</span><span class="o">&gt;</span><span class="p">(</span><span class="n">a</span>: <span class="nc">T</span><span class="p">,</span><span class="w"> </span><span class="n">b</span>: <span class="nc">T</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">bool</span> <span class="p">{</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">b</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">trait</span><span class="w"> </span><span class="n">Size</span>: <span class="nb">Sized</span> <span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">size</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"> </span><span class="n">std</span>::<span class="n">mem</span>::<span class="n">size_of</span>::<span class="o">&lt;</span><span class="n">Self</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Size</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">const</span><span class="w"> </span><span class="n">C</span>: <span class="nc">fn</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="kt">bool</span>::<span class="n">size</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="k">static</span><span class="w"> </span><span class="n">S</span>: <span class="nc">fn</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="kt">bool</span>::<span class="n">size</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">assert</span><span class="o">!</span><span class="p">(</span><span class="n">eq</span><span class="p">(</span><span class="n">C</span><span class="p">(),</span><span class="w"> </span><span class="n">S</span><span class="p">()));</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="184314656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314656">(Dec 27 2019 at 10:55)</a>:</h4>
<p>IIRC the <code>fn size()</code> function's <code>defaultness</code> is true</p>



<a name="184314662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314662">(Dec 27 2019 at 10:55)</a>:</h4>
<p>So const prop should get a TooGeneric error</p>



<a name="184314711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314711">(Dec 27 2019 at 10:56)</a>:</h4>
<p>huh, how is const prop active there at all?</p>



<a name="184314713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314713">(Dec 27 2019 at 10:56)</a>:</h4>
<p>does it run on the static?</p>



<a name="184314720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314720">(Dec 27 2019 at 10:56)</a>:</h4>
<p>do we const prop statics' and constants' bodies? :D</p>



<a name="184314733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314733">(Dec 27 2019 at 10:56)</a>:</h4>
<p>uh</p>



<a name="184314737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314737">(Dec 27 2019 at 10:56)</a>:</h4>
<p>Maybe I removed too much</p>



<a name="184314765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314765">(Dec 27 2019 at 10:57)</a>:</h4>
<p>I was mostly responding to what you said here</p>
<blockquote>
<p>The constant being used is entriely monomorphic, but const prop still bails out on it and then codegen catches it</p>
</blockquote>



<a name="184314835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314835">(Dec 27 2019 at 10:58)</a>:</h4>
<p>ah yes, so I think my idea would work here. Since <code>main</code> is monomorphic, use <code>Reveal::all()</code> for the promoted</p>



<a name="184314942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184314942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184314942">(Dec 27 2019 at 11:01)</a>:</h4>
<p>Won't that cause the same original issue if you have a downstream specialization of <code>Size</code>?</p>



<a name="184315006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315006">(Dec 27 2019 at 11:02)</a>:</h4>
<p>Is that still appropriate for monomorphic functions because specialization doesn't require substs to be applicable.</p>



<a name="184315033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315033">(Dec 27 2019 at 11:03)</a>:</h4>
<p>Like in the test, you could have just written <code>Foo::my_func()</code> and downstream there's a specialization for <code>Foo</code>.</p>



<a name="184315077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315077">(Dec 27 2019 at 11:04)</a>:</h4>
<p>But your function is still monomorphic</p>



<a name="184315094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315094">(Dec 27 2019 at 11:04)</a>:</h4>
<p>you can't override <code>Size::size</code> for any type downstream</p>



<a name="184315107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315107">(Dec 27 2019 at 11:05)</a>:</h4>
<p>a) because you have <code>impl&lt;T&gt; Size for T {}</code> here without any <code>default</code> keyowrd</p>



<a name="184315112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315112">(Dec 27 2019 at 11:05)</a>:</h4>
<p>b) because if you know all the concrete types in this crate, it can't possibly be overriden in a downstream crate because noone can implement <code>Size</code> for types from your crate</p>



<a name="184315184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315184">(Dec 27 2019 at 11:07)</a>:</h4>
<blockquote>
<p>a) because you have impl&lt;T&gt; Size for T {} here without any default keyowrd</p>
</blockquote>
<p>Maybe this is part of the issue. From what I can tell</p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Size</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">default</span> <span class="k">fn</span><span class="w"> </span><span class="n">size</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>and </p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">Size</span>: <span class="nb">Sized</span> <span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">fn</span> <span class="nf">size</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Size</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</pre></div>


<p>are represented the same in terms of <code>AssociatedItem::defaultness</code></p>



<a name="184315232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315232">(Dec 27 2019 at 11:08)</a>:</h4>
<p>yes and that's allright</p>



<a name="184315239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315239">(Dec 27 2019 at 11:08)</a>:</h4>
<div class="codehilite"><pre><span></span>   - rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::step                                                                                                                                                ▒
      - 48.74% rustc_mir::interpret::step::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::terminator (inlined)                                                                                                                      ▒
           rustc_mir::interpret::terminator::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::eval_terminator (inlined)                                                                                                               ▒
         - rustc_mir::interpret::terminator::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::eval_fn_call                                                                                                                            ▒
            - 39.91% &lt;rustc_mir::const_eval::CompileTimeInterpreter as rustc_mir::interpret::machine::Machine&gt;::find_mir_or_eval_fn                                                                                                          ▒
               - rustc_mir::interpret::terminator::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::eval_const_fn_call                                                                                                                ▒
                  - 39.52% rustc_mir::interpret::place::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::copy_op (inlined)                                                                                                            ▒
                     - rustc_mir::interpret::place::&lt;impl rustc_mir::interpret::eval_context::InterpCx&lt;M&gt;&gt;::copy_op_no_validate                                                                                                              ▒
                        - 39.28% rustc_mir::interpret::memory::Memory&lt;M&gt;::copy (inlined)                                                                                                                                                     ▒
                           - rustc_mir::interpret::memory::Memory&lt;M&gt;::copy_repeatedly                                                                                                                                                        ▒
                              - 37.58% rustc_mir::interpret::memory::Memory&lt;M&gt;::copy_undef_mask (inlined)                                                                                                                                    ▒
                                 - 37.02% rustc::mir::interpret::allocation::Allocation&lt;Tag,Extra&gt;::compress_undef_range                                                                                                                     ▒
                                    - 13.20% core::iter::range::&lt;impl core::iter::traits::iterator::Iterator for core::ops::range::Range&lt;A&gt;&gt;::next                                                                                           ▒
                                       - 8.74% core::mem::swap (inlined)                                                                                                                                                                     ▒
                                          - core::ptr::swap_nonoverlapping_one (inlined)                                                                                                                                                     ▒
                                               4.06% core::ptr::write (inlined)                                                                                                                                                              ▒
                                             - 2.95% core::ptr::read (inlined)                                                                                                                                                               ▒
                                                  core::intrinsics::copy_nonoverlapping (inlined)                                                                                                                                            ▒
                                                  core::intrinsics::overlaps (inlined)                                                                                                                                                       ▒
                                             - 1.73% core::intrinsics::copy_nonoverlapping (inlined)                                                                                                                                         ▒
                                                  core::intrinsics::overlaps (inlined)                                                                                                                                                       ▒
                                         1.48% core::cmp::impls::&lt;impl core::cmp::PartialOrd for u64&gt;::lt (inlined)
</pre></div>



<a name="184315242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315242">(Dec 27 2019 at 11:09)</a>:</h4>
<p>but the <code>impl&lt;T&gt; Size for T {}</code> prevents any further specializations of <code>Size</code></p>



<a name="184315247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315247">(Dec 27 2019 at 11:09)</a>:</h4>
<p>this is what's hot in my PR that wasn't before</p>



<a name="184315265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315265">(Dec 27 2019 at 11:09)</a>:</h4>
<p><code>compress_undef_range</code> shows very high and wasn't like that before</p>



<a name="184315324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315324">(Dec 27 2019 at 11:10)</a>:</h4>
<p>O_o</p>



<a name="184315327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315327">(Dec 27 2019 at 11:11)</a>:</h4>
<p>which test is that happening on again?</p>



<a name="184315334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315334">(Dec 27 2019 at 11:11)</a>:</h4>
<p>Well, that's not quite what we want though in terms of <code>Instance::resolve()</code> though right? </p>
<p>I would think we'd want the specialization version to give <code>None</code> when <code>Reveal::UserFacing</code> and the non-specialization version to give <code>Some(...)</code>. Am I thinking about that correctly?</p>



<a name="184315345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315345">(Dec 27 2019 at 11:11)</a>:</h4>
<p>let me parse this sentence XD</p>



<a name="184315346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315346">(Dec 27 2019 at 11:11)</a>:</h4>
<p>sorry :)</p>



<a name="184315387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315387">(Dec 27 2019 at 11:12)</a>:</h4>
<blockquote>
<p>which test is that happening on again?</p>
</blockquote>
<p>the test is the ctfe one</p>



<a name="184315389"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315389" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315389">(Dec 27 2019 at 11:12)</a>:</h4>
<p>it's not your writing. it's if X None, if !X Some</p>



<a name="184315394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315394">(Dec 27 2019 at 11:12)</a>:</h4>
<blockquote>
<blockquote>
<p>which test is that happening on again?</p>
</blockquote>
<p>the test is the ctfe one</p>
</blockquote>
<p>particularly <code>type LargeUninit = MaybeUninit&lt;[u8; 1 &lt;&lt; 24]&gt;;</code></p>



<a name="184315408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315408">(Dec 27 2019 at 11:13)</a>:</h4>
<p>Is this another instance of the "trying to eval too large a Place" issue?</p>



<a name="184315414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315414">(Dec 27 2019 at 11:13)</a>:</h4>
<p>yes-ish</p>



<a name="184315459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315459">(Dec 27 2019 at 11:14)</a>:</h4>
<p>(<a href="https://github.com/rust-lang/rust/issues/67539" target="_blank" title="https://github.com/rust-lang/rust/issues/67539">#67539</a> is the issue I'm thinking of)</p>



<a name="184315463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315463">(Dec 27 2019 at 11:14)</a>:</h4>
<p>why is copying being executed for uninitialized memory</p>



<a name="184315465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315465">(Dec 27 2019 at 11:15)</a>:</h4>
<p>unsure what the code does</p>



<a name="184315476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315476">(Dec 27 2019 at 11:15)</a>:</h4>
<p>but seems like it should return earlier?</p>



<a name="184315485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315485">(Dec 27 2019 at 11:15)</a>:</h4>
<p>yes it should :D</p>



<a name="184315566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315566">(Dec 27 2019 at 11:16)</a>:</h4>
<p>ok gonna try to see why is this not happening :)</p>



<a name="184315606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315606">(Dec 27 2019 at 11:17)</a>:</h4>
<p>because it's not implemented</p>



<a name="184315613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315613">(Dec 27 2019 at 11:17)</a>:</h4>
<p>ohh, for which case? hold on :)</p>



<a name="184315616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315616">(Dec 27 2019 at 11:17)</a>:</h4>
<p>wesley found the correct issue</p>



<a name="184315672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184315672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184315672">(Dec 27 2019 at 11:18)</a>:</h4>
<p>ahh this <a href="https://github.com/rust-lang/rust/issues/67539" target="_blank" title="https://github.com/rust-lang/rust/issues/67539">#67539</a> is the problem I'm hitting?</p>



<a name="184316173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316173">(Dec 27 2019 at 11:30)</a>:</h4>
<blockquote>
<p>Well, that's not quite what we want though in terms of <code>Instance::resolve()</code> though right? </p>
<p>I would think we'd want the specialization version to give <code>None</code> when <code>Reveal::UserFacing</code> and the non-specialization version to give <code>Some(...)</code>. Am I thinking about that correctly?</p>
</blockquote>
<p>I think you've got it but to reformulate, </p>
<p>When <code>Reveal::UserFacing</code>, I'd expect that:</p>
<ul>
<li>Specialized impls cause <code>None</code> to be returned</li>
<li>Trait default methods cause <code>Some(...)</code> to be returned</li>
</ul>



<a name="184316176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316176">(Dec 27 2019 at 11:30)</a>:</h4>
<p>Unless</p>



<a name="184316265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316265">(Dec 27 2019 at 11:32)</a>:</h4>
<p>Is this allowed?</p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">fn</span> <span class="nf">bar</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">u8</span> <span class="p">{</span><span class="w"> </span><span class="mi">42</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>


<span class="k">struct</span> <span class="nc">X</span><span class="p">;</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Baz</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="n">Baz</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">X</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nc">Baz</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">default</span> <span class="k">fn</span><span class="w"> </span><span class="n">bar</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">u8</span> <span class="p">{</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">X</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">fn</span> <span class="nf">bar</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">u8</span> <span class="p">{</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="184316270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316270">(Dec 27 2019 at 11:32)</a>:</h4>
<p>I don't remember seeing this in the rfc</p>



<a name="184316452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316452">(Dec 27 2019 at 11:36)</a>:</h4>
<p>hm... that may be possible</p>



<a name="184316487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316487">(Dec 27 2019 at 11:37)</a>:</h4>
<p><a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=056cb3d6b5708310bb7eabc141922f7b" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=056cb3d6b5708310bb7eabc141922f7b">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=056cb3d6b5708310bb7eabc141922f7b</a></p>



<a name="184316488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316488">(Dec 27 2019 at 11:37)</a>:</h4>
<p>jup that works</p>



<a name="184316496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316496">(Dec 27 2019 at 11:38)</a>:</h4>
<p>So I guess we can't do this</p>
<blockquote>
<p>Trait default methods cause Some(...) to be returned</p>
</blockquote>



<a name="184316536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316536">(Dec 27 2019 at 11:38)</a>:</h4>
<p>no</p>



<a name="184316537"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316537" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316537">(Dec 27 2019 at 11:38)</a>:</h4>
<p>So differentiating those cases doesn't matter</p>



<a name="184316651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316651">(Dec 27 2019 at 11:41)</a>:</h4>
<p>So then, per your idea, we can pass <code>Reveal::All</code> when evaluating promoted &amp; constant values <em>in a monomorphic function</em> because either 1) we declared the type in which case we have all the relevant impls and coherence prevents downstream crates from adding new ones 2) this is somebody else's type and we can see all their impls.</p>



<a name="184316710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316710">(Dec 27 2019 at 11:42)</a>:</h4>
<p>well or 3) we can't possibly be using a type from a downstream crate XD</p>



<a name="184316716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316716">(Dec 27 2019 at 11:43)</a>:</h4>
<p>I need a troll emoticon</p>



<a name="184316746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316746">(Dec 27 2019 at 11:43)</a>:</h4>
<p>although... this is basically the <code>monomorphic function</code> rule you wrote</p>



<a name="184316839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316839">(Dec 27 2019 at 11:44)</a>:</h4>
<blockquote>
<p>coherence prevents downstream crates from adding new ones</p>
</blockquote>
<p>Is this actually true? Doesn't <code>#[fundamental]</code> let you do some horrible things?</p>



<a name="184316891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316891">(Dec 27 2019 at 11:45)</a>:</h4>
<p>/me doesn't actually know what <code>#[fundamental]</code> does</p>



<a name="184316916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316916">(Dec 27 2019 at 11:45)</a>:</h4>
<p>oh god</p>



<a name="184316920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316920">(Dec 27 2019 at 11:45)</a>:</h4>
<p>I take it that's not a good sign <span aria-label="laughter tears" class="emoji emoji-1f602" role="img" title="laughter tears">:laughter_tears:</span></p>



<a name="184316973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184316973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184316973">(Dec 27 2019 at 11:46)</a>:</h4>
<p><span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="184317006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317006">(Dec 27 2019 at 11:47)</a>:</h4>
<p>I don't think you can break coherence even with fundamental types</p>



<a name="184317012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317012">(Dec 27 2019 at 11:47)</a>:</h4>
<p>That's a relief</p>



<a name="184317023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317023">(Dec 27 2019 at 11:47)</a>:</h4>
<p>though full specialization may be unsound together with fundamental types, but I'll leave that to the experts</p>



<a name="184317065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317065">(Dec 27 2019 at 11:48)</a>:</h4>
<p>for now, let's keep the simple case working as it was working before <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="184317071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317071">(Dec 27 2019 at 11:48)</a>:</h4>
<p>oh I broke miri</p>



<a name="184317073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317073">(Dec 27 2019 at 11:48)</a>:</h4>
<p>/me goes fix stuff</p>



<a name="184317905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317905">(Dec 27 2019 at 12:10)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <a href="https://github.com/rust-lang/rust/pull/67658" target="_blank" title="https://github.com/rust-lang/rust/pull/67658">https://github.com/rust-lang/rust/pull/67658</a></p>



<a name="184317915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317915">(Dec 27 2019 at 12:10)</a>:</h4>
<p>wifi died, am back now</p>



<a name="184317918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317918">(Dec 27 2019 at 12:10)</a>:</h4>
<p>after that I hope the main PR is ok :)</p>



<a name="184317994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184317994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184317994">(Dec 27 2019 at 12:12)</a>:</h4>
<p>let's run perf I guess? Or you test it for the heavily regressed file manually?</p>



<a name="184318003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318003">(Dec 27 2019 at 12:13)</a>:</h4>
<p>yep, I can do all that again :)</p>



<a name="184318065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318065">(Dec 27 2019 at 12:14)</a>:</h4>
<p>I guess I'm going to rebase the whole PR on top of master, your fix is already in and I can sit the place one on top of this fix</p>



<a name="184318068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318068">(Dec 27 2019 at 12:14)</a>:</h4>
<p>then run perf and see what happens</p>



<a name="184318070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318070">(Dec 27 2019 at 12:14)</a>:</h4>
<p>jup</p>



<a name="184318074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318074">(Dec 27 2019 at 12:14)</a>:</h4>
<p>also, early return ;)</p>



<a name="184318080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318080">(Dec 27 2019 at 12:14)</a>:</h4>
<p>Just suggested that too :)</p>



<a name="184318093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318093">(Dec 27 2019 at 12:15)</a>:</h4>
<p>XD</p>



<a name="184318111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318111">(Dec 27 2019 at 12:15)</a>:</h4>
<p>ok if both of you have strong preference on that <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="184318156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318156">(Dec 27 2019 at 12:16)</a>:</h4>
<p>I kind of preferred to hit the existing Ok but gonna change to the early return version</p>



<a name="184318235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318235">(Dec 27 2019 at 12:18)</a>:</h4>
<p>most of the functions in that file use early return</p>



<a name="184318243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318243">(Dec 27 2019 at 12:18)</a>:</h4>
<p>just look two functions up. early return even though the body is trivial afterwards</p>



<a name="184318408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318408">(Dec 27 2019 at 12:23)</a>:</h4>
<p>yeah already fixed it :)</p>



<a name="184318935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318935">(Dec 27 2019 at 12:35)</a>:</h4>
<p>Are you sure that fixes the regression in <a href="https://github.com/rust-lang/rust/issues/67539" target="_blank" title="https://github.com/rust-lang/rust/issues/67539">#67539</a>? When I tested the repro, I was still seeing slowness (see <a href="https://github.com/rust-lang/rust/issues/67539#issuecomment-568627324" target="_blank" title="https://github.com/rust-lang/rust/issues/67539#issuecomment-568627324">https://github.com/rust-lang/rust/issues/67539#issuecomment-568627324</a>)</p>



<a name="184318981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318981">(Dec 27 2019 at 12:36)</a>:</h4>
<p>I don't think we should close that issue until we're sure it's resolved.</p>



<a name="184318984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184318984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184318984">(Dec 27 2019 at 12:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> ^</p>



<a name="184319015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319015">(Dec 27 2019 at 12:37)</a>:</h4>
<p>yeah I'm not sure, I need to run perf</p>



<a name="184319025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319025">(Dec 27 2019 at 12:37)</a>:</h4>
<p>I guess I should've marked the PR as draft</p>



<a name="184319068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319068">(Dec 27 2019 at 12:38)</a>:</h4>
<p>It's fine :)</p>



<a name="184319071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319071">(Dec 27 2019 at 12:38)</a>:</h4>
<p>I need to rebase the other PR first and place it on top of that one, wait hours to compile and then run the thing so maybe in 2hs I can answer :)</p>



<a name="184319073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319073">(Dec 27 2019 at 12:38)</a>:</h4>
<p>I just think the issue you're hitting is related but a little different than OP's and we shouldn't close the issue until we're sure their issue is resolved too</p>



<a name="184319080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319080">(Dec 27 2019 at 12:38)</a>:</h4>
<p>ahh ya, that's also right yeah</p>



<a name="184319087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319087">(Dec 27 2019 at 12:39)</a>:</h4>
<p>my guess is that my issue is going to be fixed by this</p>



<a name="184319409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319409">(Dec 27 2019 at 12:48)</a>:</h4>
<p>Ah hah. <span class="user-mention" data-user-id="124288">@oli</span> I think we need a <code>.with_reveal_all()</code> <a href="https://github.com/rust-lang/rust/blob/8f5f8f916f00f7989a4ebf7b7dbfe1afd605f828/src/librustc/mir/interpret/queries.rs#L21" target="_blank" title="https://github.com/rust-lang/rust/blob/8f5f8f916f00f7989a4ebf7b7dbfe1afd605f828/src/librustc/mir/interpret/queries.rs#L21">here</a>. <code>codegen_static_initializer()</code> calls <code>const_eval_poly</code> which was getting <code>TooGeneric</code>.</p>



<a name="184319485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184319485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184319485">(Dec 27 2019 at 12:50)</a>:</h4>
<p>Ugh but that causes another issue</p>
<div class="codehilite"><pre><span></span>error[E0391]: cycle detected when const-evaluating + checking `Alpha::V3::{{constant}}#0`
  --&gt; /home/wesley/code/rust/rust/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs:5:10
   |
LL |     V3 = Self::V1 {} as u8 + 2, //~ ERROR cycle detected when const-evaluating
   |          ^^^^^^^^
   |
note: ...which requires const-evaluating + checking `Alpha::V3::{{constant}}#0`...
  --&gt; /home/wesley/code/rust/rust/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs:5:10
   |
LL |     V3 = Self::V1 {} as u8 + 2, //~ ERROR cycle detected when const-evaluating
   |          ^^^^^^^^
note: ...which requires const-evaluating `Alpha::V3::{{constant}}#0`...
  --&gt; /home/wesley/code/rust/rust/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs:5:10
   |
LL |     V3 = Self::V1 {} as u8 + 2, //~ ERROR cycle detected when const-evaluating
   |          ^^^^^^^^
   = note: ...which requires computing layout of `Alpha`...
   = note: ...which again requires const-evaluating + checking `Alpha::V3::{{constant}}#0`, completing the cycle
note: cycle used when collecting item types in top-level module
  --&gt; /home/wesley/code/rust/rust/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs:1:1
   |
LL | / #[repr(u8)]
LL | | enum Alpha {
LL | |     V1 = 41,
LL | |     V2 = Self::V1 as u8 + 1, // OK; See #50072.
...  |
LL | |
LL | | fn main() {}
   | |____________^

error: aborting due to previous error
</pre></div>



<a name="184320415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184320415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184320415">(Dec 27 2019 at 13:12)</a>:</h4>
<p>wait how is that an issue? the cycle existed before your PR, too</p>



<a name="184321337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321337">(Dec 27 2019 at 13:32)</a>:</h4>
<p>was trying out the following example ...</p>



<a name="184321345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321345">(Dec 27 2019 at 13:33)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[();</span><span class="w"> </span><span class="mi">30</span><span class="p">];</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="184321355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321355">(Dec 27 2019 at 13:33)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago tmp]$ rustc --version
rustc 1.41.0-nightly (c8ea4ace9 2019-12-14)
[santiago@galago tmp]$ time rustc test.rs

real    0m0.428s
user    0m0.317s
sys 0m0.041s
</pre></div>



<a name="184321366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321366">(Dec 27 2019 at 13:33)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago rust2 (do-not-copy-zsts)]$ time ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs

real    0m0.774s
user    0m0.592s
sys 0m0.120s
</pre></div>



<a name="184321418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321418">(Dec 27 2019 at 13:34)</a>:</h4>
<p>that one is <a href="https://github.com/rust-lang/rust/pull/67658" target="_blank" title="https://github.com/rust-lang/rust/pull/67658">https://github.com/rust-lang/rust/pull/67658</a></p>



<a name="184321434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321434">(Dec 27 2019 at 13:34)</a>:</h4>
<p>but I guess I have an old nightly</p>



<a name="184321436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321436">(Dec 27 2019 at 13:34)</a>:</h4>
<p>may be good idea to just try with master</p>



<a name="184321463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321463">(Dec 27 2019 at 13:35)</a>:</h4>
<p>going to do that</p>



<a name="184321509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184321509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184321509">(Dec 27 2019 at 13:36)</a>:</h4>
<p>Also try using hyperfine for benchmarking and using a bigger array.</p>



<a name="184323140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323140">(Dec 27 2019 at 14:13)</a>:</h4>
<p>hmm... all my PRs are up to date (enough)... what to hack on now?</p>



<a name="184323154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323154">(Dec 27 2019 at 14:14)</a>:</h4>
<p>btw <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> do you still have the llvm failures?</p>



<a name="184323210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323210">(Dec 27 2019 at 14:14)</a>:</h4>
<p>If I do <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/post.20christmas.20hack.20days/near/184319409" title="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/post.20christmas.20hack.20days/near/184319409">this</a> that resolves the LLVM issue</p>



<a name="184323212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323212">(Dec 27 2019 at 14:14)</a>:</h4>
<p>But causes the cycle</p>



<a name="184323221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323221">(Dec 27 2019 at 14:15)</a>:</h4>
<p>but the cycle is on master, too</p>



<a name="184323231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323231">(Dec 27 2019 at 14:15)</a>:</h4>
<p>What do you mean?</p>



<a name="184323237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323237">(Dec 27 2019 at 14:15)</a>:</h4>
<p>I don't think it was failing before my change</p>



<a name="184323248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323248">(Dec 27 2019 at 14:15)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs#L5" target="_blank" title="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs#L5">https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/test/ui/type-alias-enum-variants/self-in-enum-definition.rs#L5</a></p>



<a name="184323251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323251">(Dec 27 2019 at 14:15)</a>:</h4>
<p>this is master</p>



<a name="184323283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323283">(Dec 27 2019 at 14:16)</a>:</h4>
<p>huh</p>



<a name="184323302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323302">(Dec 27 2019 at 14:16)</a>:</h4>
<p>:D</p>



<a name="184323303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323303">(Dec 27 2019 at 14:16)</a>:</h4>
<p>Let me retest</p>



<a name="184323311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323311">(Dec 27 2019 at 14:16)</a>:</h4>
<p>I mean the test isn't passing</p>



<a name="184323314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323314">(Dec 27 2019 at 14:16)</a>:</h4>
<p>sure, maybe you need to --bless</p>



<a name="184323317"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323317" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323317">(Dec 27 2019 at 14:16)</a>:</h4>
<p>or maybe the span changed?</p>



<a name="184323318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323318">(Dec 27 2019 at 14:16)</a>:</h4>
<p>Oh that could be</p>



<a name="184323322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323322">(Dec 27 2019 at 14:17)</a>:</h4>
<p>(Building....)</p>



<a name="184323340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323340">(Dec 27 2019 at 14:17)</a>:</h4>
<p>like you probably have one less element in the query stack</p>



<a name="184323347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323347">(Dec 27 2019 at 14:17)</a>:</h4>
<p>eh more</p>



<a name="184323393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323393">(Dec 27 2019 at 14:18)</a>:</h4>
<p>We still have the change to the miri unleashed tests</p>



<a name="184323400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323400">(Dec 27 2019 at 14:18)</a>:</h4>
<p>because now you enter the const_eval query with reveal::all, which still tries reveal::UserFacing first</p>



<a name="184323406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323406">(Dec 27 2019 at 14:18)</a>:</h4>
<p>Are you concerned about that?</p>



<a name="184323415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323415">(Dec 27 2019 at 14:18)</a>:</h4>
<p>let me check the other thread, sec</p>



<a name="184323444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323444">(Dec 27 2019 at 14:19)</a>:</h4>
<p>ah</p>



<a name="184323449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323449">(Dec 27 2019 at 14:19)</a>:</h4>
<p>wait that <em>wasn't</em> fixed by this?</p>



<a name="184323460"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323460" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323460">(Dec 27 2019 at 14:19)</a>:</h4>
<p>I can double check but no, I believe it's still changed</p>



<a name="184323465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323465">(Dec 27 2019 at 14:19)</a>:</h4>
<p>ah</p>



<a name="184323466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323466">(Dec 27 2019 at 14:19)</a>:</h4>
<p>right</p>



<a name="184323469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323469">(Dec 27 2019 at 14:19)</a>:</h4>
<p>these are constants</p>



<a name="184323511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323511">(Dec 27 2019 at 14:20)</a>:</h4>
<p>you fixed statics</p>



<a name="184323540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323540">(Dec 27 2019 at 14:21)</a>:</h4>
<p>You said earlier about eval-ing constants with <code>Reveal::All</code>, I assume that would fix that</p>



<a name="184323548"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323548" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323548">(Dec 27 2019 at 14:21)</a>:</h4>
<p>So I should probably do that</p>



<a name="184323553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323553">(Dec 27 2019 at 14:21)</a>:</h4>
<p>basically <a href="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L296" target="_blank" title="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L296">https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L296</a> needs the same change if <a href="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L301" target="_blank" title="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L301">https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L301</a> is <code>!needs_subst()</code></p>



<a name="184323616"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323616" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323616">(Dec 27 2019 at 14:22)</a>:</h4>
<p>Easy enough</p>



<a name="184323631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323631">(Dec 27 2019 at 14:22)</a>:</h4>
<p>I should have test results in two or three minutes</p>



<a name="184323635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323635">(Dec 27 2019 at 14:22)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="184323645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323645">(Dec 27 2019 at 14:22)</a>:</h4>
<p>I need to figure out some day what <code>tcx.param_env</code> actually does</p>



<a name="184323660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323660">(Dec 27 2019 at 14:23)</a>:</h4>
<p><span aria-label="lol" class="emoji emoji-1f606" role="img" title="lol">:lol:</span></p>



<a name="184323851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323851">(Dec 27 2019 at 14:26)</a>:</h4>
<p>You were right</p>



<a name="184323856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323856">(Dec 27 2019 at 14:26)</a>:</h4>
<div class="codehilite"><pre><span></span>diff --git a/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr b/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr
index dc4050e44ab..db535b53fcf 100644
--- a/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr
+++ b/src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr
@@ -4,6 +4,11 @@ error[E0391]: cycle detected when const-evaluating + checking `Alpha::V3::{{cons
 LL |     V3 = Self::V1 {} as u8 + 2,
    |          ^^^^^^^^
    |
+note: ...which requires const-evaluating + checking `Alpha::V3::{{constant}}#0`...
+  --&gt; $DIR/self-in-enum-definition.rs:5:10
+   |
+LL |     V3 = Self::V1 {} as u8 + 2,
+   |          ^^^^^^^^
 note: ...which requires const-evaluating `Alpha::V3::{{constant}}#0`...
   --&gt; $DIR/self-in-enum-definition.rs:5:10
    |
</pre></div>



<a name="184323894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323894">(Dec 27 2019 at 14:27)</a>:</h4>
<blockquote>
<p>I need to figure out some day what <code>tcx.param_env</code> actually does</p>
</blockquote>
<p>I think the docs for it are a good starter.</p>
<p>The docs for <code>ParamEnv</code>:</p>
<blockquote>
<p>When type checking, we use the ParamEnv to track details about the set of where-clauses that are in scope at this particular point.</p>
</blockquote>
<p>The docs for <code>Reveal</code>:</p>
<blockquote>
<p>Depending on the stage of compilation, we want projection to be more or less conservative.</p>
<p>At type-checking time, we refuse to project any associated type that is marked default.</p>
<p>At codegen time, all monomorphic projections will succeed. Also, impl Trait is normalized to the concrete type, which has to be already collected by type-checking.</p>
</blockquote>



<a name="184323948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184323948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184323948">(Dec 27 2019 at 14:28)</a>:</h4>
<p>So there's one remaining failure:</p>
<div class="codehilite"><pre><span></span>---- [ui] ui/rfcs/rfc-2005-default-binding-mode/constref.rs stdout ----

error: test compilation failed although it shouldn&#39;t!
status: exit code: 1
command: &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc&quot; &quot;/home/wesley/code/rust/rust/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs&quot; &quot;-Zthreads=1&quot; &quot;--target=x86_64-unknown-linux-gnu&quot; &quot;--error-format&quot; &quot;json&quot; &quot;-Zui-testing&quot; &quot;-C&quot; &quot;prefer-dynamic&quot; &quot;-o&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2005-default-binding-mode/constref/a&quot; &quot;-Crpath&quot; &quot;-Cdebuginfo=0&quot; &quot;-Zunstable-options&quot; &quot;-Lnative=/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot; &quot;-L&quot; &quot;/home/wesley/code/rust/rust/build/x86_64-unknown-linux-gnu/test/ui/rfcs/rfc-2005-default-binding-mode/constref/auxiliary&quot;
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
error[E0158]: associated consts cannot be referenced in patterns
  --&gt; /home/wesley/code/rust/rust/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs:32:10
   |
LL |         (i32::CONST_REF_DEFAULT, i32::CONST_REF, i64::CONST_REF_DEFAULT, i64::CONST_REF) =&gt; true,
   |          ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0158`.

------------------------------------------



failures:
    [ui] ui/rfcs/rfc-2005-default-binding-mode/constref.rs
</pre></div>



<a name="184324052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324052">(Dec 27 2019 at 14:30)</a>:</h4>
<blockquote>
<p>basically <a href="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L296" target="_blank" title="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L296">https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L296</a> needs the same change if <a href="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L301" target="_blank" title="https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L301">https://github.com/rust-lang/rust/blob/41501a6b03a8f10d8c29dfcb37dbd5ff84b33f34/src/librustc_mir/transform/const_prop.rs#L301</a> is <code>!needs_subst()</code></p>
</blockquote>
<p><del>Actually, wait. Won't this cause us to use <code>Reveal::All</code> for everything not just constants?</del></p>
<p>The same logic we discussed earlier applies to everything not just constants.</p>



<a name="184324087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324087">(Dec 27 2019 at 14:30)</a>:</h4>
<p>yes, but if the thing is monomorphic, shouldn't we?</p>



<a name="184324113"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324113" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324113">(Dec 27 2019 at 14:31)</a>:</h4>
<p>Yeah</p>



<a name="184324186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324186">(Dec 27 2019 at 14:32)</a>:</h4>
<p>so the remaining failure is super weird</p>



<a name="184324193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324193">(Dec 27 2019 at 14:32)</a>:</h4>
<p>that test checks whether associated constants can be used in patterns!?</p>



<a name="184324201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324201">(Dec 27 2019 at 14:32)</a>:</h4>
<p>so that feature appears to exists</p>



<a name="184324204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324204">(Dec 27 2019 at 14:32)</a>:</h4>
<p>Yeah</p>



<a name="184324205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324205">(Dec 27 2019 at 14:32)</a>:</h4>
<p>what on earth is that error</p>



<a name="184324220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324220">(Dec 27 2019 at 14:33)</a>:</h4>
<p>I remember spending a bunch of time looking at this Christmas Eve but I don't remember what I found</p>



<a name="184324232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324232">(Dec 27 2019 at 14:33)</a>:</h4>
<p>I think I came to the conclusion something in the HIR -&gt; MIR layer needed to use <code>Reveal::All</code> but that caused a bunch of other issues</p>



<a name="184324233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324233">(Dec 27 2019 at 14:33)</a>:</h4>
<p><span class="user-mention" data-user-id="133247">@bjorn3</span> I understand what <code>ParamEnv</code> does, I don't understand how <code>tcx.param_env</code> can create a <code>ParamEnv</code> from the ether. Like what where clauses are available here?</p>



<a name="184324255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324255">(Dec 27 2019 at 14:34)</a>:</h4>
<p>And seems like a bad fix to me</p>



<a name="184324275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324275">(Dec 27 2019 at 14:34)</a>:</h4>
<p>I am mostly wondering why the rustc source contains <code>"associated consts cannot be referenced in patterns"</code> somewhere if we have a feature permitting just that</p>



<a name="184324298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324298">(Dec 27 2019 at 14:34)</a>:</h4>
<p>huh</p>



<a name="184324301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324301">(Dec 27 2019 at 14:34)</a>:</h4>
<p>It's not feature gated?</p>



<a name="184324324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324324">(Dec 27 2019 at 14:35)</a>:</h4>
<p>nope: no gates in this test: <a href="https://github.com/rust-lang/rust/blob/master/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs">https://github.com/rust-lang/rust/blob/master/src/test/ui/rfcs/rfc-2005-default-binding-mode/constref.rs</a></p>



<a name="184324342"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324342" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324342">(Dec 27 2019 at 14:35)</a>:</h4>
<blockquote>
<p><span class="user-mention silent" data-user-id="133247">bjorn3</span> I understand what <code>ParamEnv</code> does, I don't understand how <code>tcx.param_env</code> can create a <code>ParamEnv</code> from the ether. Like what where clauses are available here?</p>
</blockquote>
<p>It takes a <code>DefId</code>, it gets them from there (using <code>predicates_of</code>)</p>



<a name="184324345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324345">(Dec 27 2019 at 14:35)</a>:</h4>
<p>I think what the error message is trying to tell us is that you can't write <code>Trait::ASSOC_CONSTANT</code> without this somehow resolving to a <code>ConcreteType::ASSOC_CONSTANT</code></p>



<a name="184324425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324425">(Dec 27 2019 at 14:37)</a>:</h4>
<p><span class="user-mention" data-user-id="116118">@Matthew Jasper</span> oh, so it's basically just like IdentitySubsts, you get all the where bounds, but they are still polymorphic where bounds</p>



<a name="184324435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324435">(Dec 27 2019 at 14:37)</a>:</h4>
<p>Yeah seems like a bad error message</p>



<a name="184324437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324437">(Dec 27 2019 at 14:37)</a>:</h4>
<p>Yes</p>



<a name="184324492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324492">(Dec 27 2019 at 14:38)</a>:</h4>
<p>Maybe it needs to say something like "generic associated constants"</p>



<a name="184324590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324590">(Dec 27 2019 at 14:40)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> ok so I think I know what's going on. This is supposed to catch <code>T::ASSOC_CONST</code> in patterns, but it currently does so by relying on const eval to bail out with <code>TooGeneric</code>. Your changes now make it bail out immediately for <code>ConcreteType::TRAIT_ASSOC_CONST</code> because that is only available in reveal_all mode</p>



<a name="184324601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324601">(Dec 27 2019 at 14:40)</a>:</h4>
<p>Interesting...</p>



<a name="184324606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324606">(Dec 27 2019 at 14:40)</a>:</h4>
<p>(The const prop change fixes those miri unleashed constant tests BTW)</p>



<a name="184324614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324614">(Dec 27 2019 at 14:41)</a>:</h4>
<p>this seems totally fine to use <code>self.param_env.with_reveal_all()</code>, because just like with const prop of non-generic functions, patterns are always monomorphic even if their function isn't</p>



<a name="184324622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324622">(Dec 27 2019 at 14:41)</a>:</h4>
<p>now you said something about more failures being caused by this</p>



<a name="184324626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324626">(Dec 27 2019 at 14:42)</a>:</h4>
<p>so I'm unsure what's up with that, do you remember anything?</p>



<a name="184324675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324675">(Dec 27 2019 at 14:42)</a>:</h4>
<p>I may have made the change too high in the compilation process so it affected too many things</p>



<a name="184324682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324682">(Dec 27 2019 at 14:42)</a>:</h4>
<p>oh also please leave comments at all the <code>with_reveal_all</code> sites explaining why we are using it for each specific site</p>



<a name="184324684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324684">(Dec 27 2019 at 14:42)</a>:</h4>
<p>Let see if I can pull it out of the reflog</p>



<a name="184324706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324706">(Dec 27 2019 at 14:43)</a>:</h4>
<p>yea if you made the <code>param_env</code> field <code>reveal_all</code> I'd totally understand this causing more failures</p>



<a name="184324762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324762">(Dec 27 2019 at 14:44)</a>:</h4>
<p>I think this was the patch I tried:</p>
<div class="codehilite"><pre><span></span><span class="gh">diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs</span>
<span class="gh">index 869aeeba418..051a0177022 100644</span>
<span class="gd">--- a/src/librustc_mir/hair/pattern/mod.rs</span>
<span class="gi">+++ b/src/librustc_mir/hair/pattern/mod.rs</span>
<span class="gu">@@ -743,7 +743,7 @@ impl&lt;&#39;a, &#39;tcx&gt; PatCtxt&lt;&#39;a, &#39;tcx&gt; {</span>
         let kind = match res {
             Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssocConst, def_id) =&gt; {
                 let substs = self.tables.node_substs(id);
<span class="gd">-                match self.tcx.const_eval_resolve(self.param_env, def_id, substs, Some(span)) {</span>
<span class="gi">+                match self.tcx.const_eval_resolve(self.param_env.with_reveal_all(), def_id, substs, Some(span)) {</span>
                     Ok(value) =&gt; {
                         let pattern = self.const_to_pat(value, id, span);
                         if !is_associated_const {
</pre></div>



<a name="184324765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324765">(Dec 27 2019 at 14:45)</a>:</h4>
<p>yea, that looks correct to me</p>



<a name="184324787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184324787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184324787">(Dec 27 2019 at 14:45)</a>:</h4>
<p>Ok. Let me try applying it and see what happens.</p>



<a name="184325023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325023">(Dec 27 2019 at 14:50)</a>:</h4>
<div class="codehilite"><pre><span></span>test result: ok. 9410 passed; 0 failed; 45 ignored; 0 measured; 0 filtered out
</pre></div>


<p><span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="184325062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325062">(Dec 27 2019 at 14:51)</a>:</h4>
<p>woooo, awesome</p>



<a name="184325074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325074">(Dec 27 2019 at 14:51)</a>:</h4>
<p><span aria-label="ship" class="emoji emoji-1f6a2" role="img" title="ship">:ship:</span> it :D (ok no, I'll review first)</p>



<a name="184325077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325077">(Dec 27 2019 at 14:51)</a>:</h4>
<p>Writing comments now</p>



<a name="184325078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325078">(Dec 27 2019 at 14:51)</a>:</h4>
<p>:)</p>



<a name="184325222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325222">(Dec 27 2019 at 14:54)</a>:</h4>
<p>in case the rollup in <a href="https://github.com/rust-lang/rust/pull/67660" target="_blank" title="https://github.com/rust-lang/rust/pull/67660">https://github.com/rust-lang/rust/pull/67660</a> goes through, can you also remove my hacks from <a href="https://github.com/rust-lang/rust/pull/67631" target="_blank" title="https://github.com/rust-lang/rust/pull/67631">https://github.com/rust-lang/rust/pull/67631</a> in your PR?</p>



<a name="184325242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325242">(Dec 27 2019 at 14:54)</a>:</h4>
<p>Yeah I can do that</p>



<a name="184325737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325737">(Dec 27 2019 at 15:03)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago tmp]$ hyperfine --warmup 3 &#39;rustc /tmp/test.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
Benchmark #1: rustc /tmp/test.rs
  Time (mean ± σ):      2.977 s ±  0.124 s    [User: 2.641 s, System: 0.092 s]
  Range (min … max):    2.761 s …  3.140 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs
  Time (mean ± σ):      4.334 s ±  0.240 s    [User: 3.888 s, System: 0.131 s]
  Range (min … max):    3.923 s …  4.642 s    10 runs

Summary
  &#39;rustc /tmp/test.rs&#39; ran
    1.46 ± 0.10 times faster than &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
[santiago@galago tmp]$ hyperfine --warmup 3 &#39;/home/santiago/src/oss/r /rustc /tmp/test.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
rayon/       rust0/       rust1/       rust2/       rust3/       rustc-guide/ rust-clippy/ rustc-perf/
[santiago@galago tmp]$ hyperfine --warmup 3 &#39;/home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
Benchmark #1: /home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs
  Time (mean ± σ):      4.726 s ±  0.273 s    [User: 4.293 s, System: 0.172 s]
  Range (min … max):    4.045 s …  5.002 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs
  Time (mean ± σ):      4.606 s ±  0.181 s    [User: 4.251 s, System: 0.140 s]
  Range (min … max):    4.310 s …  4.978 s    10 runs

Summary
  &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39; ran
    1.03 ± 0.07 times faster than &#39;/home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
</pre></div>



<a name="184325789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325789">(Dec 27 2019 at 15:04)</a>:</h4>
<p>rustc is <code>rustc 1.41.0-nightly (c8ea4ace9 2019-12-14)</code></p>



<a name="184325804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325804">(Dec 27 2019 at 15:04)</a>:</h4>
<p>the one in rust1 is master and the one in rust2 is master with the patch we were talking about</p>



<a name="184325815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325815">(Dec 27 2019 at 15:04)</a>:</h4>
<p>so it doesn't fix the issue reported</p>



<a name="184325820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184325820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184325820">(Dec 27 2019 at 15:05)</a>:</h4>
<p>I can try and check if it does fix my issue</p>



<a name="184326171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326171">(Dec 27 2019 at 15:11)</a>:</h4>
<p>and my test ...</p>



<a name="184326172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326172">(Dec 27 2019 at 15:11)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago myapp (master)]$ hyperfine --warmup 3 &#39;/home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
Benchmark #1: /home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs
  Time (mean ± σ):      7.364 s ±  0.140 s    [User: 6.524 s, System: 0.707 s]
  Range (min … max):    7.101 s …  7.585 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs
  Time (mean ± σ):      6.539 s ±  0.265 s    [User: 5.828 s, System: 0.523 s]
  Range (min … max):    6.291 s …  7.071 s    10 runs

Summary
  &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39; ran
    1.13 ± 0.05 times faster than &#39;/home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
[santiago@galago myapp (master)]$ hyperfine --warmup 3 &#39;/home/santiago/src/oss/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
</pre></div>



<a name="184326195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326195">(Dec 27 2019 at 15:11)</a>:</h4>
<p>makes it a bit faster</p>



<a name="184326264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326264">(Dec 27 2019 at 15:13)</a>:</h4>
<p>hmm... so I looked at your callgraph dump</p>



<a name="184326265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326265">(Dec 27 2019 at 15:13)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago myapp (master)]$ hyperfine --warmup 3 &#39;rustc /tmp/test.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
Benchmark #1: rustc /tmp/test.rs
  Time (mean ± σ):      1.438 s ±  0.154 s    [User: 1.376 s, System: 0.048 s]
  Range (min … max):    1.310 s …  1.820 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs
  Time (mean ± σ):      1.840 s ±  0.336 s    [User: 1.763 s, System: 0.057 s]
  Range (min … max):    1.576 s …  2.555 s    10 runs

Summary
  &#39;rustc /tmp/test.rs&#39; ran
    1.28 ± 0.27 times faster than &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc /tmp/test.rs&#39;
</pre></div>



<a name="184326270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326270">(Dec 27 2019 at 15:13)</a>:</h4>
<p>it looks like you're not on top of master</p>



<a name="184326278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326278">(Dec 27 2019 at 15:13)</a>:</h4>
<p>yeah the callgraph dump is old</p>



<a name="184326279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326279">(Dec 27 2019 at 15:13)</a>:</h4>
<p>ok</p>



<a name="184326285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326285">(Dec 27 2019 at 15:13)</a>:</h4>
<p>So we are in <a href="https://github.com/rust-lang/rust/blob/3ac40b69c75929dac5115b6a49eb4f1ecc352416/src/librustc_mir/const_eval/machine.rs#L25" target="_blank" title="https://github.com/rust-lang/rust/blob/3ac40b69c75929dac5115b6a49eb4f1ecc352416/src/librustc_mir/const_eval/machine.rs#L25">https://github.com/rust-lang/rust/blob/3ac40b69c75929dac5115b6a49eb4f1ecc352416/src/librustc_mir/const_eval/machine.rs#L25</a></p>



<a name="184326332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326332">(Dec 27 2019 at 15:14)</a>:</h4>
<p>so this patch makes things a bit faster 3% for the reported issue and 13% for my case</p>



<a name="184326338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326338">(Dec 27 2019 at 15:14)</a>:</h4>
<p>still my case is 27% slower than an old nightly</p>



<a name="184326345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326345">(Dec 27 2019 at 15:14)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/3ac40b69c75929dac5115b6a49eb4f1ecc352416/src/librustc_mir/const_eval/machine.rs#L53" target="_blank" title="https://github.com/rust-lang/rust/blob/3ac40b69c75929dac5115b6a49eb4f1ecc352416/src/librustc_mir/const_eval/machine.rs#L53">https://github.com/rust-lang/rust/blob/3ac40b69c75929dac5115b6a49eb4f1ecc352416/src/librustc_mir/const_eval/machine.rs#L53</a> seems to be the culprit entry point</p>



<a name="184326362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326362">(Dec 27 2019 at 15:14)</a>:</h4>
<p>yes</p>



<a name="184326394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326394">(Dec 27 2019 at 15:15)</a>:</h4>
<p>can we break out of that earlier would be the question?</p>



<a name="184326406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326406">(Dec 27 2019 at 15:15)</a>:</h4>
<p>what's the program you're compiling right now to check the perf?</p>



<a name="184326484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326484">(Dec 27 2019 at 15:17)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(const_fn, const_let)]</span><span class="w"></span>
<span class="k">use</span><span class="w"> </span><span class="n">std</span>::<span class="n">mem</span>::<span class="n">MaybeUninit</span><span class="p">;</span><span class="w"></span>

<span class="c1">// Try to make CTFE actually do a lot of computation, without producing a big result.</span>
<span class="c1">// The const fn expressions evaluated here take a dummy u32 argument because otherwise</span>
<span class="c1">// const fn memoisation is able to eliminate a lot of the work.</span>
<span class="c1">// And without support for loops.</span>

<span class="n">macro_rules</span><span class="o">!</span><span class="w"> </span><span class="n">const_repeat</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// Base case: Use 16 at the end to avoid function calls at the leafs as much as possible.</span>
<span class="w">    </span><span class="p">([</span><span class="mi">16</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span>: <span class="nc">expr</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span>: <span class="nc">ty</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{{</span><span class="w"></span>
<span class="w">        </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="p">;</span><span class="w"> </span><span class="cp">$e</span><span class="w"></span>
<span class="w">    </span><span class="p">}};</span><span class="w"></span>
<span class="w">    </span><span class="p">([</span><span class="mi">1</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span>: <span class="nc">expr</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span>: <span class="nc">ty</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{{</span><span class="w"></span>
<span class="w">        </span><span class="cp">$e</span><span class="w"></span>
<span class="w">    </span><span class="p">}};</span><span class="w"></span>
<span class="w">    </span><span class="c1">// Recursive case: Take a 16</span>
<span class="w">    </span><span class="p">([</span><span class="mi">16</span><span class="w"> </span><span class="cp">$($n</span>: <span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span>: <span class="nc">expr</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span>: <span class="nc">ty</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{{</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">e</span><span class="p">(</span><span class="n">_</span>: <span class="kt">u32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="cp">$T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">const_repeat</span><span class="o">!</span><span class="p">([</span><span class="cp">$($n</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}};</span><span class="w"></span>
<span class="w">    </span><span class="c1">// Recursive case: Take a 8</span>
<span class="w">    </span><span class="p">([</span><span class="mi">8</span><span class="w"> </span><span class="cp">$($n</span>: <span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span>: <span class="nc">expr</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span>: <span class="nc">ty</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{{</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">e</span><span class="p">(</span><span class="n">_</span>: <span class="kt">u32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="cp">$T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">const_repeat</span><span class="o">!</span><span class="p">([</span><span class="cp">$($n</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}};</span><span class="w"></span>
<span class="w">    </span><span class="c1">// Recursive case: Take a 4</span>
<span class="w">    </span><span class="p">([</span><span class="mi">4</span><span class="w"> </span><span class="cp">$($n</span>: <span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span>: <span class="nc">expr</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span>: <span class="nc">ty</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{{</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">e</span><span class="p">(</span><span class="n">_</span>: <span class="kt">u32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="cp">$T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">const_repeat</span><span class="o">!</span><span class="p">([</span><span class="cp">$($n</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}};</span><span class="w"></span>
<span class="w">    </span><span class="c1">// Recursive case: Take a 2</span>
<span class="w">    </span><span class="p">([</span><span class="mi">2</span><span class="w"> </span><span class="cp">$($n</span>: <span class="nc">tt</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span>: <span class="nc">expr</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span>: <span class="nc">ty</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"> </span><span class="p">{{</span><span class="w"></span>
<span class="w">        </span><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">e</span><span class="p">(</span><span class="n">_</span>: <span class="kt">u32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="cp">$T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">const_repeat</span><span class="o">!</span><span class="p">([</span><span class="cp">$($n</span><span class="p">)</span><span class="o">*</span><span class="p">]</span><span class="w"> </span><span class="cp">$e</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span><span class="p">)</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span><span class="w"> </span><span class="n">e</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}};</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="n">macro_rules</span><span class="o">!</span><span class="w"> </span><span class="n">expensive_static</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">(</span><span class="cp">$name</span>: <span class="nc">ident</span><span class="w"> </span>: <span class="cp">$T</span>: <span class="nc">ty</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="cp">$e</span><span class="w"> </span>: <span class="nc">expr</span><span class="p">;</span><span class="w"> </span><span class="cp">$count</span>: <span class="nc">tt</span><span class="p">)</span><span class="w"> </span><span class="o">=&gt;</span><span class="w"></span>
<span class="w">        </span><span class="p">(</span><span class="k">pub</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="cp">$name</span><span class="w"> </span>: <span class="cp">$T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">const_repeat</span><span class="o">!</span><span class="p">(</span><span class="cp">$count</span><span class="w"> </span><span class="cp">$e</span><span class="p">,</span><span class="w"> </span><span class="cp">$T</span><span class="p">);)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">Trait</span>: <span class="nb">Sync</span> <span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">Trait</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">inc</span><span class="p">(</span><span class="n">i</span>: <span class="kt">i32</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kt">i32</span> <span class="p">{</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="c1">// The numbers in the brackets are iteration counts. E.g., [4 16 16] means</span>
<span class="c1">// 4 * 16 * 16 = 2^(2+4+4) = 2^10 iterations.</span>
<span class="c1">//expensive_static!(CAST: usize = 42i32 as u8 as u64 as i8 as isize as usize; [8 16 16 16 16]);</span>
<span class="c1">//expensive_static!(CONST_FN: i32 = inc(42); [8 16 16 16 16]);</span>
<span class="c1">//expensive_static!(FIELDS: &amp;&#39;static i32 = &amp;(&quot;bar&quot;, 42, &quot;foo&quot;, 3.14).1; [8 16 16 16 16]);</span>
<span class="c1">//expensive_static!(FORCE_ALLOC: i32 = *****(&amp;&amp;&amp;&amp;&amp;5); [8 16 16 16 16]);</span>
<span class="c1">//expensive_static!(CHECKED_INDEX: u8 = b&quot;foomp&quot;[3]; [8 16 16 16 16]);</span>
<span class="c1">//expensive_static!(OPS: i32 = ((((10 &gt;&gt; 1) + 3) * 7) / 2 - 12) &lt;&lt; 4; [4 16 16 16 16]);</span>
<span class="c1">//expensive_static!(RELOCATIONS : &amp;&#39;static str = &quot;hello&quot;; [8 16 16 16 16]);</span>
<span class="c1">//expensive_static!(UNSIZE_SLICE: &amp;&#39;static [u8] = b&quot;foo&quot;; [4 16 16 16 16 16]);</span>
<span class="c1">//expensive_static!(UNSIZE_TRAIT: &amp;&#39;static Trait = &amp;42u32; [4 16 16 16 16 16]);</span>

<span class="c1">// copying all these zeros and the corresponding definedness bits can be expensive and is probably</span>
<span class="c1">// prone to regressions.</span>
<span class="c1">// 24 is an exponent that makes the repeat expression take less than two seconds to compute</span>
<span class="c1">//const FOO: [i32; 1 &lt;&lt; 30] = [0; 1 &lt;&lt; 30];</span>

<span class="c1">// Try CTFE that operate on values that contain largely uninitialized memory, not requiring any</span>
<span class="c1">// particular representation in MIR.</span>
<span class="k">type</span> <span class="nc">LargeUninit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MaybeUninit</span><span class="o">&lt;</span><span class="p">[</span><span class="kt">u8</span><span class="p">;</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="mi">24</span><span class="p">]</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="c1">// copying uninitialized bytes could also be expensive and could be optimized independently, so</span>
<span class="c1">// track regressions here separately. It should also be less costly to compose new values</span>
<span class="c1">// containing largly undef bytes.</span>
<span class="k">const</span><span class="w"> </span><span class="n">BAR</span>: <span class="nc">LargeUninit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">();</span><span class="w"></span>

<span class="c1">// Check the evaluation time of passing through a function.</span>
<span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">id</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">val</span>: <span class="nc">T</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">T</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">val</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">const</span><span class="w"> </span><span class="n">ID</span>: <span class="nc">LargeUninit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">id</span><span class="p">(</span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">());</span><span class="w"></span>

<span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">build</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nc">LargeUninit</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">const</span><span class="w"> </span><span class="n">BUILD</span>: <span class="nc">LargeUninit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">build</span><span class="p">();</span><span class="w"></span>

<span class="c1">// Largely uninitialized memory but initialized with tag at the start, in both cases.</span>
<span class="k">const</span><span class="w"> </span><span class="n">NONE</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">LargeUninit</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">None</span><span class="p">;</span><span class="w"></span>
<span class="k">const</span><span class="w"> </span><span class="n">SOME</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">LargeUninit</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">());</span><span class="w"></span>

<span class="c1">// A large uninit surrounded by initialized bytes whose representation is surely computed.</span>
<span class="k">const</span><span class="w"> </span><span class="n">SURROUND</span>: <span class="p">(</span><span class="kt">u8</span><span class="p">,</span><span class="w"> </span><span class="n">LargeUninit</span><span class="p">,</span><span class="w"> </span><span class="kt">u8</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">(),</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
<span class="k">const</span><span class="w"> </span><span class="n">SURROUND_ID</span>: <span class="p">(</span><span class="kt">u8</span><span class="p">,</span><span class="w"> </span><span class="n">LargeUninit</span><span class="p">,</span><span class="w"> </span><span class="kt">u8</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">id</span><span class="p">((</span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">(),</span><span class="w"> </span><span class="mi">0</span><span class="p">));</span><span class="w"></span>

<span class="c1">// Check actual codegen for these values.</span>
<span class="k">pub</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">STATIC_BAR</span>: <span class="nc">LargeUninit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">();</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">STATIC_NONE</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">LargeUninit</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">None</span><span class="p">;</span><span class="w"></span>
<span class="k">pub</span><span class="w"> </span><span class="k">static</span><span class="w"> </span><span class="n">STATIC_SOME</span>: <span class="nb">Option</span><span class="o">&lt;</span><span class="n">LargeUninit</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">MaybeUninit</span>::<span class="n">uninit</span><span class="p">());</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</pre></div>



<a name="184326501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326501">(Dec 27 2019 at 15:17)</a>:</h4>
<p>i guess I can reduce that and just leave the <code>LargeUninit</code> stuff around</p>



<a name="184326512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326512">(Dec 27 2019 at 15:17)</a>:</h4>
<p>I can run perf again with the updated thing too</p>



<a name="184326693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326693">(Dec 27 2019 at 15:20)</a>:</h4>
<p>so ...</p>



<a name="184326706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326706">(Dec 27 2019 at 15:21)</a>:</h4>
<p>running perf on my nightly and my pr</p>



<a name="184326712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326712">(Dec 27 2019 at 15:21)</a>:</h4>
<div class="codehilite"><pre><span></span>    45.83%             librustc_driver-fb30b83f718b75a1.so  [.] rustc::mir::interpret::allocation::Allocation&lt;Tag,Extra&gt;::compress_undef_range
    38.10%             librustc_driver-fb30b83f718b75a1.so  [.] core::iter::range::&lt;impl core::iter::traits::iterator::Iterator for core::ops::range::Range&lt;A&gt;&gt;::next
     7.35%             librustc_driver-fb30b83f718b75a1.so  [.] &lt;rustc_hash::FxHasher as core::hash::Hasher&gt;::write
</pre></div>



<a name="184326716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326716">(Dec 27 2019 at 15:21)</a>:</h4>
<p>this is <code>perf diff</code></p>



<a name="184326723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184326723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184326723">(Dec 27 2019 at 15:21)</a>:</h4>
<p>45% slowdown in <code>compress_undef_range</code></p>



<a name="184327000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184327000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184327000">(Dec 27 2019 at 15:26)</a>:</h4>
<p>and that's basically <code>copy_repeatedly</code></p>



<a name="184327095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184327095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184327095">(Dec 27 2019 at 15:28)</a>:</h4>
<p>ok so it seems like this is not returning early</p>



<a name="184327551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184327551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184327551">(Dec 27 2019 at 15:37)</a>:</h4>
<p>walking fuchur, I'll be back in an hour</p>



<a name="184329661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329661">(Dec 27 2019 at 16:19)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> just in case, I didn't run perf on the issue so I'm not really sure what's going on</p>



<a name="184329663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329663">(Dec 27 2019 at 16:19)</a>:</h4>
<p>Oh right, the PR you Rebased over only cares about zsts</p>



<a name="184329674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329674">(Dec 27 2019 at 16:19)</a>:</h4>
<p>in my case the example I'm running is not a zst</p>



<a name="184329684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329684">(Dec 27 2019 at 16:19)</a>:</h4>
<p>Yea</p>



<a name="184329695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329695">(Dec 27 2019 at 16:19)</a>:</h4>
<p>so of course the example is not going to help</p>



<a name="184329760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329760">(Dec 27 2019 at 16:20)</a>:</h4>
<p>unsure what to do for my case</p>



<a name="184329774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329774">(Dec 27 2019 at 16:20)</a>:</h4>
<p>There was a PR by someone. They closed it themselves b/c they don't have time. Iirc that prevented copies on undef</p>



<a name="184329781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329781">(Dec 27 2019 at 16:20)</a>:</h4>
<p>Can we resolve this by optimizing <code>compress_undef_range()</code> more?</p>



<a name="184329849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329849">(Dec 27 2019 at 16:22)</a>:</h4>
<p>Not really, the slow thing is the bytes, not the undef mask</p>



<a name="184329856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329856">(Dec 27 2019 at 16:22)</a>:</h4>
<p>Like, what if instead of reading 1 byte at a time, we read 4 bytes or 8 or something.</p>



<a name="184329861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329861">(Dec 27 2019 at 16:22)</a>:</h4>
<p>I assume there's some constant overhead to reading any number of bytes</p>



<a name="184329862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329862">(Dec 27 2019 at 16:22)</a>:</h4>
<p>Could we reduce that by reading more at a time?</p>



<a name="184329865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329865">(Dec 27 2019 at 16:22)</a>:</h4>
<p>Ah, true</p>



<a name="184329878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329878">(Dec 27 2019 at 16:23)</a>:</h4>
<p>But that's an orthogonal optimization</p>



<a name="184329879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184329879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184329879">(Dec 27 2019 at 16:23)</a>:</h4>
<p>Yeah</p>



<a name="184330067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330067">(Dec 27 2019 at 16:26)</a>:</h4>
<p>Let's do that in a separate PR</p>



<a name="184330100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330100">(Dec 27 2019 at 16:27)</a>:</h4>
<p>The "everything is undef, copy nothing" optimization is basically what is needed to undo the regression here</p>



<a name="184330229"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330229" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330229">(Dec 27 2019 at 16:29)</a>:</h4>
<p>yeah, that seems better :)</p>



<a name="184330301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330301">(Dec 27 2019 at 16:30)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> did you find a PR or something?</p>



<a name="184330323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330323">(Dec 27 2019 at 16:31)</a>:</h4>
<p>jep: literally this second: <a href="https://github.com/rust-lang/rust/pull/62655" target="_blank" title="https://github.com/rust-lang/rust/pull/62655">https://github.com/rust-lang/rust/pull/62655</a></p>



<a name="184330392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330392">(Dec 27 2019 at 16:32)</a>:</h4>
<p>ok</p>



<a name="184330399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330399">(Dec 27 2019 at 16:32)</a>:</h4>
<p>going for lunch, maybe later I can provide a PR like that one</p>



<a name="184330415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330415">(Dec 27 2019 at 16:33)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> let's close this <a href="https://github.com/rust-lang/rust/pull/67658" target="_blank" title="https://github.com/rust-lang/rust/pull/67658">https://github.com/rust-lang/rust/pull/67658</a> I guess?</p>



<a name="184330425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330425">(Dec 27 2019 at 16:33)</a>:</h4>
<p>nono :D</p>



<a name="184330437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330437">(Dec 27 2019 at 16:33)</a>:</h4>
<p>again, another orthogonal optimization</p>



<a name="184330536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330536">(Dec 27 2019 at 16:35)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> do you want to proceed with the reading more bytes idea? or should I?</p>



<a name="184330561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330561">(Dec 27 2019 at 16:36)</a>:</h4>
<p>If you have other stuff to work on, I don't mind taking it</p>



<a name="184330605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330605">(Dec 27 2019 at 16:36)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> if you want to test your zst fix PR, you can add <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=dd34e88a742b93dad4433bb46e22a666" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=dd34e88a742b93dad4433bb46e22a666">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=dd34e88a742b93dad4433bb46e22a666</a> to the ui test suite :D</p>



<a name="184330618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330618">(Dec 27 2019 at 16:36)</a>:</h4>
<p>basically this is a canary that will just never finish compiling</p>



<a name="184330656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330656">(Dec 27 2019 at 16:37)</a>:</h4>
<p>well, maybe not just the test, but add a comment that the test should compile in microseconds</p>



<a name="184330660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330660">(Dec 27 2019 at 16:37)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> Should we r- your PR to work around the const prop issue since the rollup failed?</p>



<a name="184330662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330662">(Dec 27 2019 at 16:37)</a>:</h4>
<p>yes</p>



<a name="184330778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184330778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184330778">(Dec 27 2019 at 16:39)</a>:</h4>
<blockquote>
<p>If you have other stuff to work on, I don't mind taking it</p>
</blockquote>
<p>please do</p>



<a name="184332556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184332556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184332556">(Dec 27 2019 at 17:12)</a>:</h4>
<p>/me went out to get some lunch &amp; is back now.</p>



<a name="184332978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184332978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184332978">(Dec 27 2019 at 17:21)</a>:</h4>
<p>I couldn't find any MIR stuff to do so I'm fixing match ICEs around constants in patterns now</p>



<a name="184333115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333115">(Dec 27 2019 at 17:24)</a>:</h4>
<p>One maybe kind of large project would be to do something about this hack in the Inliner <a href="https://github.com/rust-lang/rust/issues/67557#issuecomment-568746201" target="_blank" title="https://github.com/rust-lang/rust/issues/67557#issuecomment-568746201">https://github.com/rust-lang/rust/issues/67557#issuecomment-568746201</a> which is pretty annoying and means we miss a lot of inlining opportunity within a module.</p>



<a name="184333199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333199">(Dec 27 2019 at 17:26)</a>:</h4>
<p>XD yea that hack is horrible</p>



<a name="184333233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333233">(Dec 27 2019 at 17:28)</a>:</h4>
<p>I swear I've wasted at least 4 hours trying to figure out why a mir-opt test isn't working only to realize I need to move one function above another</p>



<a name="184333286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333286">(Dec 27 2019 at 17:28)</a>:</h4>
<p><span aria-label="frown" class="emoji emoji-1f641" role="img" title="frown">:frown:</span></p>



<a name="184333381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333381">(Dec 27 2019 at 17:31)</a>:</h4>
<p>Without touching the query system to detect cycles, the only fix idea I've had so far is to add a <code>has_function_call_to(body: DefId, check: DefId) -&gt; bool</code> query that tells you whether <code>body</code>'s <code>mir::Body</code> contains a <code>TerminatorKind</code> call to <code>check</code>, recursively</p>



<a name="184333404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333404">(Dec 27 2019 at 17:31)</a>:</h4>
<p>though then you'd need a <code>&amp;[DefId]</code> for <code>check</code>, because you need to build up the call stack</p>



<a name="184333455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333455">(Dec 27 2019 at 17:32)</a>:</h4>
<p>for better caching <code>Set&lt;DefId&gt;</code> would make more sense than <code>&amp;[DefId]</code>, though using that as a query key may be... bad</p>



<a name="184333590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333590">(Dec 27 2019 at 17:35)</a>:</h4>
<p>This is not ideal, but what if we ran all the other optimizations except the inliner and made a query for that? We could then use that query in the inliner without cycles.</p>



<a name="184333633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333633">(Dec 27 2019 at 17:36)</a>:</h4>
<p>the other optimizations may be more effective after inlining</p>



<a name="184333634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333634">(Dec 27 2019 at 17:36)</a>:</h4>
<p>We'd of course miss things but we don't run the inliner currently anyway for normal builds so we may be in a better state than we are now</p>



<a name="184333637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184333637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184333637">(Dec 27 2019 at 17:36)</a>:</h4>
<p>Yeah</p>



<a name="184337726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337726">(Dec 27 2019 at 19:01)</a>:</h4>
<p>for the reported issue ...</p>



<a name="184337729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337729">(Dec 27 2019 at 19:01)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago myapp (master)]$ hyperfine --warmup 3 &#39;rustc src/main.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
Benchmark #1: rustc src/main.rs
  Time (mean ± σ):     16.157 s ±  1.099 s    [User: 16.014 s, System: 0.061 s]
  Range (min … max):   14.315 s … 17.247 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs
  Time (mean ± σ):     13.251 s ±  0.651 s    [User: 13.132 s, System: 0.058 s]
  Range (min … max):   12.470 s … 14.153 s    10 runs

Summary
  &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39; ran
    1.22 ± 0.10 times faster than &#39;rustc src/main.rs&#39;
</pre></div>



<a name="184337735"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337735" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337735">(Dec 27 2019 at 19:02)</a>:</h4>
<p>the PR is 22% faster</p>



<a name="184337796"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337796" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337796">(Dec 27 2019 at 19:02)</a>:</h4>
<p>that has exercised this example ...</p>



<a name="184337799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337799">(Dec 27 2019 at 19:02)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[();</span><span class="w"> </span><span class="mi">100_000_000</span><span class="p">];</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="184337930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337930">(Dec 27 2019 at 19:05)</a>:</h4>
<p>and for the ctfe stress test we get ...</p>



<a name="184337931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337931">(Dec 27 2019 at 19:05)</a>:</h4>
<div class="codehilite"><pre><span></span>[santiago@galago myapp (master)]$ hyperfine --warmup 3 &#39;rustc src/main.rs&#39; &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
Benchmark #1: rustc src/main.rs
  Time (mean ± σ):      1.650 s ±  0.158 s    [User: 1.352 s, System: 0.337 s]
  Range (min … max):    1.334 s …  1.814 s    10 runs

Benchmark #2: ~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs
  Time (mean ± σ):      2.689 s ±  0.470 s    [User: 2.483 s, System: 0.237 s]
  Range (min … max):    2.272 s …  3.609 s    10 runs

Summary
  &#39;rustc src/main.rs&#39; ran
    1.63 ± 0.32 times faster than &#39;~/src/oss/rust2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/main.rs&#39;
</pre></div>



<a name="184337975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337975">(Dec 27 2019 at 19:06)</a>:</h4>
<p>63% slower so no improvements at all</p>



<a name="184337980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184337980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184337980">(Dec 27 2019 at 19:06)</a>:</h4>
<p>can check against current master quickly</p>



<a name="184339756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184339756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184339756">(Dec 27 2019 at 19:44)</a>:</h4>
<p>Hmmm</p>



<a name="184339805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184339805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184339805">(Dec 27 2019 at 19:45)</a>:</h4>
<p><span class="user-mention" data-user-id="116266">@Santiago Pastorino</span> and I paired on this on a call and we've got this cut-down repro:</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="kd">let</span><span class="w"> </span><span class="n">_</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[();</span><span class="w"> </span><span class="mi">100_000_000</span><span class="p">];</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>from ~9 seconds on my machine to &lt; 0.3.</p>



<a name="184339811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184339811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184339811">(Dec 27 2019 at 19:45)</a>:</h4>
<p>The fix is <a href="https://github.com/rust-lang/rust/issues/67667" target="_blank" title="https://github.com/rust-lang/rust/issues/67667">#67667</a></p>



<a name="184340018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340018">(Dec 27 2019 at 19:49)</a>:</h4>
<p>I've got some stuff around the house I need to go do so I'm signing off. This was a lot of fun and I'm looking forward tomorrow! <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="184340026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340026">(Dec 27 2019 at 19:49)</a>:</h4>
<p>Well, that fix doesn't work for <code>struct Foo;</code>... Maybe compute the layout of tys (the element type) before the match and report the uninhabited error if. ...<br>
OK, see you tomorrow</p>



<a name="184340085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340085">(Dec 27 2019 at 19:50)</a>:</h4>
<p>... the layout is uninhabited and otherwise skip validation if the type is zst</p>



<a name="184340091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340091">(Dec 27 2019 at 19:50)</a>:</h4>
<blockquote>
<p>Well, that fix doesn't work for struct Foo;</p>
</blockquote>
<p>Are you sure? </p>
<div class="codehilite"><pre><span></span>wesley@endurance:~/code/rust/rust&gt; cat test.rs
#[derive(Clone, Copy)]
struct Foo;

fn main() {
    let _ = [Foo; 4_000_000_000];
}
wesley@endurance:~/code/rust/rust&gt; time rustc +stage1 --emit mir test.rs

real    0m0.084s
user    0m0.051s
sys     0m0.012s
</pre></div>



<a name="184340103"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340103" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340103">(Dec 27 2019 at 19:51)</a>:</h4>
<p>Huh??</p>



<a name="184340104"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340104" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340104">(Dec 27 2019 at 19:51)</a>:</h4>
<p>Oh</p>



<a name="184340109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340109">(Dec 27 2019 at 19:51)</a>:</h4>
<p>Then <code>struct Foo(());</code></p>



<a name="184340117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340117">(Dec 27 2019 at 19:51)</a>:</h4>
<p>That's fair</p>



<a name="184340176"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340176" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340176">(Dec 27 2019 at 19:52)</a>:</h4>
<p>still the ctfe-stress test I guess is not fixed by any of these fixes ...</p>



<a name="184340185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340185">(Dec 27 2019 at 19:52)</a>:</h4>
<p>I'll change it later to use the layout or at worst case tomorrow morning</p>



<a name="184340187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340187">(Dec 27 2019 at 19:52)</a>:</h4>
<p>No rush</p>



<a name="184340191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340191">(Dec 27 2019 at 19:52)</a>:</h4>
<p>New party tomorrow</p>



<a name="184340192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340192">(Dec 27 2019 at 19:52)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="184340593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340593">(Dec 27 2019 at 20:00)</a>:</h4>
<p>Quite weird. That constant being copied shouldn't actually cause any copying for allocations full of undefs</p>



<a name="184340767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340767">(Dec 27 2019 at 20:02)</a>:</h4>
<p>Maybe the memory ends up being marked as initialized out of some reason</p>



<a name="184340782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184340782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184340782">(Dec 27 2019 at 20:02)</a>:</h4>
<p>Though I still can't fathom how that happens</p>



<a name="184368418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184368418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184368418">(Dec 28 2019 at 09:55)</a>:</h4>
<p>morning <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="184368485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184368485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184368485">(Dec 28 2019 at 09:57)</a>:</h4>
<p>Oops overslept. Breakfast now, see you soon</p>



<a name="184368838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184368838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184368838">(Dec 28 2019 at 10:08)</a>:</h4>
<p>Got my <span aria-label="coffee" class="emoji emoji-2615" role="img" title="coffee">:coffee:</span></p>



<a name="184368981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184368981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184368981">(Dec 28 2019 at 10:13)</a>:</h4>
<p>gonna brew mine too <span aria-label="coffee" class="emoji emoji-2615" role="img" title="coffee">:coffee:</span></p>



<a name="184370437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184370437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184370437">(Dec 28 2019 at 11:01)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="184371513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184371513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184371513">(Dec 28 2019 at 11:35)</a>:</h4>
<p>I'm finishing up some changes to const prop so we lint overflowing integer casts and then I'll finish up the perf improvement for large inhabited ZST arrays</p>



<a name="184372237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372237">(Dec 28 2019 at 11:57)</a>:</h4>
<p>rebasing <a href="https://github.com/rust-lang/rust/issues/67000" target="_blank" title="https://github.com/rust-lang/rust/issues/67000">#67000</a> :)</p>



<a name="184372421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372421">(Dec 28 2019 at 12:02)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> </p>
<blockquote>
<p>layout.size == Size::ZERO &amp;&amp; !layout.is_uninhabited()</p>
</blockquote>
<p>Do you mean <code>layout.size == Size::ZERO &amp;&amp; !layout.details.abi.is_unhabited()</code>?</p>



<a name="184372432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372432">(Dec 28 2019 at 12:03)</a>:</h4>
<p>oh, yea</p>



<a name="184372437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372437">(Dec 28 2019 at 12:03)</a>:</h4>
<p>Ok, cool</p>



<a name="184372495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372495">(Dec 28 2019 at 12:04)</a>:</h4>
<p>in this case this is the conservative method, as the fallback even happens for types which are uninhabited but not from all modules</p>



<a name="184372504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372504">(Dec 28 2019 at 12:05)</a>:</h4>
<p>What does that mean "from all modules"?</p>



<a name="184372581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372581">(Dec 28 2019 at 12:07)</a>:</h4>
<p>well... if you have <code>struct Foo(!)</code> the <code>.0</code> field is not visible outside the module, thus <code>Foo</code> is not uninhabited outside its defining module</p>



<a name="184372618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372618">(Dec 28 2019 at 12:08)</a>:</h4>
<p>but if you look at the layout's Abi, then you get the raw information of its uninhabitedness as codegen would see it</p>



<a name="184372654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372654">(Dec 28 2019 at 12:09)</a>:</h4>
<p>Wait, are you saying you get a different layout for <code>Foo</code> depending on what module you're in?</p>



<a name="184372657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372657">(Dec 28 2019 at 12:09)</a>:</h4>
<p>No, you're talking about the logical type not the layout</p>



<a name="184372717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372717">(Dec 28 2019 at 12:11)</a>:</h4>
<p>Ok, I think I get it</p>



<a name="184372766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372766">(Dec 28 2019 at 12:12)</a>:</h4>
<p>Outside of the module, <code>Foo</code> is some opaque type because it has no public fields. So we don't know anything about it from a type system perspective. Layout however knows the internals and can see it's fully uninhabited</p>



<a name="184372840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372840">(Dec 28 2019 at 12:14)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> Ralf wants </p>
<blockquote>
<p>Also please add a test making sure that we correctly validate things like (!, !) and struct Empty(!);.</p>
</blockquote>
<p>Since the change is making things faster, wouldn't this test just show this is slow? I don't think we want to add deliberately slow tests to the suite and I don't know how we'd even make the test fail if the optimization kicked in. Do you know what he is looking for?</p>



<a name="184372851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372851">(Dec 28 2019 at 12:15)</a>:</h4>
<p>Is there a way I can do something invalid with an uninhabited ZST type array and get an error to trigger that would have been bypassed by these changes?</p>



<a name="184372854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372854">(Dec 28 2019 at 12:15)</a>:</h4>
<p>No, the test would be a compile-fail test, because validation errors out on these things</p>



<a name="184372856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372856">(Dec 28 2019 at 12:15)</a>:</h4>
<p>basically Ralf wants to know they are still failing</p>



<a name="184372904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372904">(Dec 28 2019 at 12:16)</a>:</h4>
<p>with your PR at the point where Ralf saw it, it would have validated  a value of type <code>Empty</code> and said "oh this is valid"</p>



<a name="184372910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372910">(Dec 28 2019 at 12:16)</a>:</h4>
<p>Yeah, I tested that locally and that is resolved now with the change you suggested</p>



<a name="184372911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372911">(Dec 28 2019 at 12:16)</a>:</h4>
<p>so <code>const FOO: Empty = transmute(());</code> would have compiled successfully</p>



<a name="184372923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372923">(Dec 28 2019 at 12:17)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span>  yea so just add a few tests that <code>const FOO: [Empty; 3]</code> or so can never compile successfully</p>



<a name="184372985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184372985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184372985">(Dec 28 2019 at 12:18)</a>:</h4>
<p>I'm just not sure what to put on the right hand side</p>



<a name="184373006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373006">(Dec 28 2019 at 12:20)</a>:</h4>
<p>I need to call a function that returns <code>!</code> right?</p>



<a name="184373047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373047">(Dec 28 2019 at 12:20)</a>:</h4>
<p>But I can't call functions in const contexts</p>



<a name="184373287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373287">(Dec 28 2019 at 12:29)</a>:</h4>
<p>I think I've done something wrong since this compiles:</p>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(const_fn)]</span><span class="w"></span>
<span class="cp">#![feature(const_transmute)]</span><span class="w"></span>

<span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="o">!</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">std</span>::<span class="n">mem</span>::<span class="n">transmute</span><span class="p">(())</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">enum</span> <span class="nc">Empty</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="cp">#[warn(const_err)]</span><span class="w"></span>
<span class="k">const</span><span class="w"> </span><span class="n">FOO</span>: <span class="p">[</span><span class="n">Empty</span><span class="p">;</span><span class="w"> </span><span class="mi">3</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="n">foo</span><span class="p">();</span><span class="w"> </span><span class="mi">3</span><span class="p">];</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="184373346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373346">(Dec 28 2019 at 12:31)</a>:</h4>
<p>Err maybe that's expected since the transmute is hidden in the function?</p>



<a name="184373391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373391">(Dec 28 2019 at 12:32)</a>:</h4>
<p>This fails:</p>
<div class="codehilite"><pre><span></span><span class="cp">#![feature(const_transmute)]</span><span class="w"></span>

<span class="cp">#[derive(Clone, Copy)]</span><span class="w"></span>
<span class="k">enum</span> <span class="nc">Empty</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>

<span class="cp">#[warn(const_err)]</span><span class="w"></span>
<span class="k">const</span><span class="w"> </span><span class="n">FOO</span>: <span class="p">[</span><span class="n">Empty</span><span class="p">;</span><span class="w"> </span><span class="mi">3</span><span class="p">]</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">std</span>::<span class="n">mem</span>::<span class="n">transmute</span><span class="p">(())</span><span class="w"> </span><span class="p">};</span><span class="w"> </span><span class="mi">3</span><span class="p">];</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>with "type validation failed: encountered a value of an uninhabited type"</p>



<a name="184373395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373395">(Dec 28 2019 at 12:32)</a>:</h4>
<p>well it errors the moment you actually use <code>FOO</code></p>



<a name="184373396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373396">(Dec 28 2019 at 12:32)</a>:</h4>
<p>like if you add <code>FOO;</code> in <code>fn main()</code></p>



<a name="184373397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373397">(Dec 28 2019 at 12:32)</a>:</h4>
<p>Ah ok</p>



<a name="184373406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184373406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184373406">(Dec 28 2019 at 12:33)</a>:</h4>
<p>constants having errors only fails the build if they are actually used</p>



<a name="184377451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184377451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184377451">(Dec 28 2019 at 14:34)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I think I misunderstood what that branch was doing. I thought it skipped checking for numeric types. It actually checks the entire array at once. So the PR already checks the array for ZSTs.</p>



<a name="184379949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184379949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184379949">(Dec 28 2019 at 15:47)</a>:</h4>
<p>This sort of feels like we're re-inventing <code>FromAnyBytes</code> from this Pre-RFC <a href="https://internals.rust-lang.org/t/pre-rfc-v2-safe-transmute/11431" target="_blank" title="https://internals.rust-lang.org/t/pre-rfc-v2-safe-transmute/11431">https://internals.rust-lang.org/t/pre-rfc-v2-safe-transmute/11431</a></p>



<a name="184380004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380004">(Dec 28 2019 at 15:48)</a>:</h4>
<p>Maybe we should do the simple thing for now and leverage that code later?</p>



<a name="184380011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380011">(Dec 28 2019 at 15:49)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="124288">@oli</span> ^</p>



<a name="184380739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380739">(Dec 28 2019 at 16:10)</a>:</h4>
<p>ok</p>



<a name="184380755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380755">(Dec 28 2019 at 16:11)</a>:</h4>
<p>so basically struct with no fields and struct with no fields?</p>



<a name="184380758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380758">(Dec 28 2019 at 16:11)</a>:</h4>
<p>just like you had in the beginning?</p>



<a name="184380759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380759">(Dec 28 2019 at 16:11)</a>:</h4>
<p>leave a FIXME though</p>



<a name="184380760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184380760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184380760">(Dec 28 2019 at 16:11)</a>:</h4>
<p>tuple with no fields and struct with no fields yeah</p>



<a name="184381315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/Post%20Christmas%20hack%20days/near/184381315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/Post.20Christmas.20hack.20days.html#184381315">(Dec 28 2019 at 16:26)</a>:</h4>
<p>btw <a href="https://github.com/rust-lang/rust/pull/67658#discussion_r361801255" target="_blank" title="https://github.com/rust-lang/rust/pull/67658#discussion_r361801255">https://github.com/rust-lang/rust/pull/67658#discussion_r361801255</a> unsure about this to be honest?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>